home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 74 / IOPROG_74.ISO / soft / Codice / Libro Visual Basic e Database / FormMain.vb < prev    next >
Encoding:
Text File  |  2003-09-30  |  5.7 KB  |  158 lines

  1. Imports System.Data.SqlClient
  2. Public Class FormMain
  3.     Inherits System.Windows.Forms.Form
  4.  
  5. #Region " Windows Form Designer generated code "
  6.  
  7.     Public Sub New()
  8.         MyBase.New()
  9.  
  10.         'This call is required by the Windows Form Designer.
  11.         InitializeComponent()
  12.  
  13.         'Add any initialization after the InitializeComponent() call
  14.  
  15.     End Sub
  16.  
  17.     'Form overrides dispose to clean up the component list.
  18.     Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
  19.         If disposing Then
  20.             If Not (components Is Nothing) Then
  21.                 components.Dispose()
  22.             End If
  23.         End If
  24.         MyBase.Dispose(disposing)
  25.     End Sub
  26.  
  27.     'Required by the Windows Form Designer
  28.     Private components As System.ComponentModel.IContainer
  29.  
  30.     'NOTE: The following procedure is required by the Windows Form Designer
  31.     'It can be modified using the Windows Form Designer.  
  32.     'Do not modify it using the code editor.
  33.     Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu
  34.     Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem
  35.     Friend WithEvents MenuItem6 As System.Windows.Forms.MenuItem
  36.     Friend WithEvents mnuScarico As System.Windows.Forms.MenuItem
  37.     Friend WithEvents mnuRicercaDocumenti As System.Windows.Forms.MenuItem
  38.     Friend WithEvents mnuClienti As System.Windows.Forms.MenuItem
  39.     Friend WithEvents mnuFornitori As System.Windows.Forms.MenuItem
  40.     Friend WithEvents mnuArticoli As System.Windows.Forms.MenuItem
  41.     Friend WithEvents mnuCarico As System.Windows.Forms.MenuItem
  42.     <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  43.         Me.MainMenu1 = New System.Windows.Forms.MainMenu()
  44.         Me.MenuItem1 = New System.Windows.Forms.MenuItem()
  45.         Me.mnuClienti = New System.Windows.Forms.MenuItem()
  46.         Me.mnuFornitori = New System.Windows.Forms.MenuItem()
  47.         Me.mnuArticoli = New System.Windows.Forms.MenuItem()
  48.         Me.MenuItem6 = New System.Windows.Forms.MenuItem()
  49.         Me.mnuCarico = New System.Windows.Forms.MenuItem()
  50.         Me.mnuScarico = New System.Windows.Forms.MenuItem()
  51.         Me.mnuRicercaDocumenti = New System.Windows.Forms.MenuItem()
  52.         '
  53.         'MainMenu1
  54.         '
  55.         Me.MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem1, Me.MenuItem6})
  56.         '
  57.         'MenuItem1
  58.         '
  59.         Me.MenuItem1.Index = 0
  60.         Me.MenuItem1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuClienti, Me.mnuFornitori, Me.mnuArticoli})
  61.         Me.MenuItem1.Text = "Anagrafica"
  62.         '
  63.         'mnuClienti
  64.         '
  65.         Me.mnuClienti.Index = 0
  66.         Me.mnuClienti.Text = "Clienti"
  67.         '
  68.         'mnuFornitori
  69.         '
  70.         Me.mnuFornitori.Index = 1
  71.         Me.mnuFornitori.Text = "Fornitori"
  72.         '
  73.         'mnuArticoli
  74.         '
  75.         Me.mnuArticoli.Index = 2
  76.         Me.mnuArticoli.Text = "Articoli"
  77.         '
  78.         'MenuItem6
  79.         '
  80.         Me.MenuItem6.Index = 1
  81.         Me.MenuItem6.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuCarico, Me.mnuScarico, Me.mnuRicercaDocumenti})
  82.         Me.MenuItem6.Text = "Documenti"
  83.         '
  84.         'mnuCarico
  85.         '
  86.         Me.mnuCarico.Index = 0
  87.         Me.mnuCarico.Text = "Carico"
  88.         '
  89.         'mnuScarico
  90.         '
  91.         Me.mnuScarico.Index = 1
  92.         Me.mnuScarico.Text = "Scarico"
  93.         '
  94.         'mnuRicercaDocumenti
  95.         '
  96.         Me.mnuRicercaDocumenti.Index = 2
  97.         Me.mnuRicercaDocumenti.Text = "Ricerca"
  98.         '
  99.         'FormMain
  100.         '
  101.         Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
  102.         Me.ClientSize = New System.Drawing.Size(576, 462)
  103.         Me.IsMdiContainer = True
  104.         Me.Menu = Me.MainMenu1
  105.         Me.Name = "FormMain"
  106.         Me.Text = "Gestione MiniMarket"
  107.  
  108.     End Sub
  109.  
  110. #End Region
  111.  
  112.     Private Sub FormMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  113.         ObjConnection = New SqlConnection()
  114.         ObjConnection.ConnectionString = "Initial Catalog=gestmarket;Data Source=localhost;Integrated Security=SSPI;"
  115.         ObjConnection.Open()
  116.     End Sub
  117.  
  118.  
  119.  
  120.     Private Sub mnuClienti_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuClienti.Click
  121.         Dim frmCliente As New FormCliente()
  122.         frmCliente.MdiParent = Me
  123.         frmCliente.Show()
  124.     End Sub
  125.  
  126.     Private Sub mnuFornitori_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuFornitori.Click
  127.         Dim frmFornitore As New FormFornitore()
  128.         frmFornitore.MdiParent = Me
  129.         frmFornitore.Show()
  130.     End Sub
  131.  
  132.     Private Sub mnuArticoli_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuArticoli.Click
  133.         Dim frmArticolo As New FormArticolo()
  134.         frmArticolo.MdiParent = Me
  135.         frmArticolo.Show()
  136.     End Sub
  137.  
  138.     Private Sub mnuCarico_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuCarico.Click
  139.         Dim frmDocumento As New FormDocumento()
  140.         frmDocumento.MdiParent = Me
  141.         frmDocumento.MioShow("Carico")
  142.     End Sub
  143.  
  144.     Private Sub mnuScarico_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuScarico.Click
  145.         Dim frmDocumento As New FormDocumento()
  146.         frmDocumento.MdiParent = Me
  147.         frmDocumento.MioShow("Scarico")
  148.     End Sub
  149.  
  150.     Private Sub mnuRicercaDocumenti_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuRicercaDocumenti.Click
  151.     End Sub
  152.  
  153.  
  154.     Private Sub FormMain_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
  155.         ObjConnection.Close()
  156.     End Sub
  157. End Class
  158.